class BookingsController < ApplicationController
	def create
		@booking = Booking.new(booking_params)
				
		if @booking.save
			redirect_to event_path(@booking.event_id)
		else
			raise "Error while saving the booking: booking not valid"
		end
	end
	
	private
		def booking_params
			params.require(:booking).permit(:event_name, :structure_name)
		end

end
